
%\documentclass[letterpaper,12pt]{article}
%\usepackage[x11names,rgb]{xcolor}
%\usepackage{tikz}
%\usetikzlibrary{snakes}
%\usetikzlibrary{arrows}
%\usetikzlibrary{shapes}
%\usetikzlibrary{backgrounds}
%\usepackage{amsmath}
%\oddsidemargin 0in
%\evensidemargin 0in
%\topmargin 0in
%\headheight 0in
%\headsep 0in
%\textheight 9in
%\textwidth 6.5in
%\begin{document}
%\pagestyle{empty}
%\vspace*{\fill}
%\begin{center}
\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=0.8]
	    	% domain boundary 
	    	\draw (0,0) rectangle (8,8);
	    	% the blocks ...
	    	\draw[fill=blue!70] (6,0) rectangle +(2,2);
	    	\draw[fill=blue!70] (5.5,3.5) rectangle +(0.5,0.5);
	    	\draw[fill=blue!70] (6.5,7) rectangle +(0.5,0.5);
	    	\draw[fill=blue!70] (1,6.5) rectangle +(0.5,0.5);
	    	
	    	%First Additional Octant ...
	    	\draw[fill=blue!15] (0,0) rectangle +(4,4);
	    	\path (2,1.5) node[above] {1};
	    	
	    	%Second Additional Octant ...
	    	\draw[fill=blue!15] (7,7) rectangle +(1,1);
	    	\path (7.5,7) node[above] {2};
	    	
	    	% Octree ...
	    	\draw[black, very thin, step=4cm] (0,0) grid (8,8);	
	    	\draw[black, very thin, step=2cm] (4,0) grid +(4,8);
	    	\draw[black, very thin, step=2cm] (0,4) grid +(4,4);		
	    	\draw[black, very thin, step=1cm] (4,2) grid +(2,2);		
	    	\draw[black, very thin, step=1cm] (0,6) grid +(2,2);		
	    	\draw[black, very thin, step=1cm] (6,6) grid +(2,2);		
	    	\draw[black, very thin, step=0.5cm] (6,7) grid +(1,1);		
	    	\draw[black, very thin, step=0.5cm] (1,6) grid +(1,1);		
	    	\draw[black, very thin, step=0.5cm] (5,3) grid +(1,1);		
	    	
	    \end{tikzpicture} %%
\end{preview}
\end{document}

%\end{center}
%\vspace*{\fill}
%\end{document}

    